<?php


        if (!empty($_POST['id'])) {

            foreach ($_POST['id'] as $v) {

                $id = $v;
                $sql = "update `news` set `status` = 1 where `id` = $id";
                mysqli_query($link,$sql);
            }
            $row = mysqli_affected_rows($link);
            if (!empty($_SERVER['HTTP_X_REQUESTED_WITH'])) {
                echo $row;die;
            }

        }

?>
